Example: Let the input string be “i like this program very much”. The function should change the string to “much very program this like i”...
Given a 2D square matrix, find the sum of elements in Principal and Secondary diagonals. For example, consider the following 4 X 4 input matrix....
Given a 2D square matrix, find the sum of elements in Principal and Secondary diagonals. For example, consider the following 4 X 4 input matrix....
Given a string, the task is to reverse the order of the words in the given string....
Onto Function is one of the many types of functions defined based on the relationship between its domain and codomain. For any function to be onto, it needs to relate two sets with a very specific mapping between elements, meaning that each element of the codomain has at least one element in the domain as its pre-image. In simple words, for any function, if all the elements of the codomain are mapped to some element of the domain, then the function is said to be an onto function....
Sequences and Series: In mathematics, the sequence is a collection or list of numbers that have a logical/sequential order or pattern between them. For example, 1, 5, 9, 13, … is a sequence having a difference of 4 between each consecutive next term and each term can be represented in form 1 + 4 * ( n – 1 ) where n is the nth term of the sequence. The sequence can be classified into 3 categories:...
Given an array, the task is to find average of that array. Average is the sum of array elements divided by the number of elements....
(i) For any two sets A and B either A B or B A....
Interval notation is a method used to represent continuous sets of real numbers by specifying their boundaries. Written intervals resemble ordered pairs but are not used to indicate specific points. Instead, they serve as a concise means to express inequalities or systems of inequalities, providing a shorthand form to describe the range of values within those boundaries....
Quadratic inequalities are a type of algebraic inequality that involves quadratic expressions. A quadratic inequality looks like ax2+bx+c>0, ax2+bx+c<0, ax2+bx+c≥0 or ax2+bx+c≤, where a, b, and c are constants, and a≠0....